<?php

namespace app\admin\model;

use app\common\model\BaseModel;
use think\model\concern\SoftDelete;

class MerchantAreaLog extends BaseModel
{

    use SoftDelete;

    

    // 表名
    protected $name = 'merchant_area_log';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];




    //类型
    public function getTypeList($type = null)
    {
        $data = ['1' => __('添加'), '2' => __('编辑'), '3' => __('删除')];
        if ($type){
            return $data[$type];
        }else{
            return $data;
        }
    }

    public function admin(){
        return $this->hasOne('admin','id','admin_id')->joinType('left');
    }



}
